package com.boot.unity.api.wx.controller;

import com.alibaba.fastjson.JSONObject;
import com.boot.unity.api.wx.service.WxH5SchoolDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/wx/h5SchoolData")
public class WxH5SchoolDataController {
    @Autowired
    private WxH5SchoolDataService adminH5SchoolDataService;


    @GetMapping("schoolAllForStu")
    public Object schoolAllForStu(String school, String token) {
        return adminH5SchoolDataService.schoolAllForStu(school, token);
    }

    /**
     * 统计学员学习进度
     *
     * @param school
     * @param token
     * @return
     */
    @GetMapping("/countStuStatus")
    public Object countStuStatus(String school, String token) {
        return adminH5SchoolDataService.countStuStatus(school, token);
    }

    /**
     * 统计缴费、结算、未结算金额
     *
     * @param school
     * @param token
     * @return
     */
    @GetMapping("/countPayAndSettleAndUnSettleMoney")
    public Object countPayAndSettleAndUnSettleMoney(String school, String token) {
        return adminH5SchoolDataService.countPayAndSettleAndUnSettleMoney(school, token);
    }

    /**
     * 获取最近7天报名数量
     *
     * @param school
     * @param token
     * @return
     */
    @GetMapping("/countStuNumRecent7")
    public Object countStuNumRecent7(String school, String token) {
        return adminH5SchoolDataService.countStuNumRecent7(school, token);
    }

    /**
     * 获取每个月的报名数量，按照年计算
     */
    @GetMapping("stuYearCount")
    public Object stuYearCount(String school, String token) {
        return adminH5SchoolDataService.stuYearCount(school, token);

    }

    /**
     * 按车型统计报名人数
     *
     * @param school
     * @param token
     * @return
     */
    @GetMapping("/countTrainTypeNum")
    public Object countTrainTypeNum(String school, String token) {
        return adminH5SchoolDataService.countTrainTypeNum(school, token);

    }

    /**
     * 获取驾校结业学员数量
     */
    @GetMapping("/queryJyCount")
    public Object queryJyCount(String school, String token) {
        return adminH5SchoolDataService.queryJyCount(school, token);

    }

    /**
     * 获取学员年龄结构
     */
    @GetMapping("/queryAge")
    public Object queryAge(String school, String token) {
        return adminH5SchoolDataService.queryAge(school, token);

    }

    /**
     * 统计近七次结算金额
     *
     * @param school
     * @param token
     * @return
     */
    @GetMapping("/countLast7DaysSettlementAmount")
    public Object countLast7DaysSettlementAmount(String school, String token) {
        return adminH5SchoolDataService.countLast7DaysSettlementAmount(school, token);
    }

    /**
     * 统计各个车型的·收入情况
     *
     * @param school
     * @param token
     * @return
     */
    @GetMapping("/countModelsIncome")
    public Object countModelsIncome(String school, String token) {
        return adminH5SchoolDataService.countModelsIncome(school, token);
    }

    /**
     * 统计已毕业、未毕业学员
     *
     * @param school
     * @param token
     * @return
     */
    @GetMapping("/countGraduateAndUngraduateStuNum")
    public Object countGraduateAndUngraduateStuNum(String school, String token) {
        return adminH5SchoolDataService.countGraduateAndUngraduateStuNum(school, token);
    }

    /**
     *教练中心--我的招生--报名已缴费学员
     * */
    @GetMapping("/getZsListPay")
    public Object getZsListPay(String manager , String token, String info, Integer limit, Integer page) {
        return adminH5SchoolDataService.getZsListPay(manager, token,info,limit,page);
    }


    /**
     *教练中心--我的招生--报名未缴费学员
     */
    @GetMapping("/getZsListNoPay")
    public Object getZsListNoPay(String manager , String token, String info, Integer limit, Integer page) {
        return adminH5SchoolDataService.getZsListNoPay(manager, token,info,limit,page);

    }

    /**
     * 教练中心--校长看板--我的学员
     * @return
     */
    @GetMapping("/getSchoolXyList")
    public Object getSchoolXyList(String manager , String token, String info, Integer limit, Integer page) {
        return adminH5SchoolDataService.getSchoolXyList(manager, token,info,limit,page);
    }

    @GetMapping("/queryNewsAll")
    public Object queryNewsAll(String type, String page){
        return adminH5SchoolDataService.queryNewsAll(type,page);
    }

}
